<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Document</title>
    <style>
    #dv{
        width: 900px;
        height: 900px;
        border: 1px solid black;
    }
    </style>
    <script src="jquery-2.0.0.min.js"></script>
    <script>
        var arr=[
            {"name":"爱奇艺1","href":"https://www.iqiyi.com"},
            {"name":"爱奇艺2","href":"http://www.aiqiyi.cn"},
            {"name":"爱奇艺3","href":"http://www.aiqiyi.cn"},
            {"name":"爱奇艺4","href":"http://www.aiqiyi.cn"},
            {"name":"爱奇艺5","href":"http://www.aiqiyi.cn"},
            {"name":"爱奇艺6","href":"http://www.aiqiyi.cn"},
            {"name":"爱奇艺7","href":"http://www.aiqiyi.cn"},
            
        ];
        $(function(){
            $("#btn").click(function(){
                var table=$("<table border='1' cellspacing='0' cellpadding='0'></table>");
                 $("#dv").append(table);
                 for(var i=0;i<arr.length;i++){
                     var dt=arr[i];
                     var tr=$("<tr></tr>");
                     table.append(tr);
                     var td1=$("<td>"+dt.name+"</td>");
                     tr.append(td1);

                     var td2=$("<td><a href='"+dt.href+"'>"+dt.name+"</a></td>");
                     tr.append(td2);
                 }
                })
                $("#btn2").click(function(){
                    // $(this).next().empty();
                    // $("#dv").remove();
                    // 
                    $("#dv").children("table").remove();
                });
                $("#btn3").click(function(){
                    var tr=$("<tr><td>tengxun</td><td><a href='http://www.tengcun.com'>tengxun</a></td></tr>");
                    $("#dv").children("table").append(tr);
                });
            })
           
    </script>
</head>
<body>
    <input type="button" value="button" id="btn">
    <input type="button" value="button" id="btn2">
    <input type="button" value="button" id="btn3">
    <div id="dv"></div>
    
    
</body>
</html>